import { PageContainer } from "@ant-design/pro-layout";
import useCommonTable from "@/hooks/useCommonTable";
import { fetchList, remove } from "@/api/user";
import { Avatar } from "antd";

export default () => {
  const columns = [
    {
      title: "会员ID",
      dataIndex: "openId",
      width: 150,
    },
    {
      title: "昵称",
      dataIndex: "nickName",
      width: 150,
    },
    {
      title: "昵称/头像",
      dataIndex: "avatar",
      width: 150,
      search: false,
      render: (_, record) => {
        return <Avatar src={record.avatar}></Avatar>;
      },
    },
    { title: "电话", dataIndex: "mobile", width: 150 },

    { title: "成为团长次数", dataIndex: "headGroupCount", width: 150, search: false },
    { title: "注册时间", dataIndex: "createTime", width: 150, search: false },
    { title: "拼团地址", dataIndex: "recentJoinAddress", width: 150, search: false },
    { title: "拼团次数", dataIndex: "joinCount", width: 150, search: false },
  ];
  return (
    <PageContainer>
      {useCommonTable({
        columns,
        renderEdit: () => {},
        remove,
        modalWidth: 700,
        fetchList,
        renderAdd: () => {},
        layout: "horizontal",
        actionColumnWidth: 200,
        showCheckbox: false,
      })}
    </PageContainer>
  );
};
